package org.zezs.sync.mongo;

import java.io.IOException;
import java.util.Properties;

public class Constants {
    //es配置文件地址
    public static String esfile = "/es.json";
    //mongo配置
    public static String mondbfile = "/mongo.json";
    //同步配置文件
    public static String syncfile = "/sync.json";
    //同步唯一标记字段
    public static String mongoId = "mogoid";
    //使用es处理错误导致排序时候必须用和这个字段了
    public static String mongoIdSort = "mogoid.key";
    //清洗配置数据库
    public static String paramConfig = "paramConfig";


    public static void load(){
        Properties properties=new Properties();

        try {
            properties.load( Constants.class.getResourceAsStream("/sys.properties"));
            esfile=properties.getProperty("esfile");
            syncfile=properties.getProperty("syncfile");
            syncfile=properties.getProperty("syncfile");
            mongoId=properties.getProperty("mongoId");
            mongoIdSort=properties.getProperty("mongoIdSort");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
